Skip to main content

Input field

Type

widget

Description

Text fields allow users to enter text into a UI. They typically appear in forms and dialogs.

Associated Syntax

Property

NameSummarySyntax
stateThe current state of the widget.set the state of <widget> to state get the state of <widget>
supportingTextColorThe color of the widget supporting text.set the supportingTextColor of <widget> to <Color> get the supportingTextColor of <widget>
textAlignThe alignment of the textset the textAlign of <widget> to textAlign get the textAlign of <widget>
lockTextMake the widget non editable.set the lockText of <widget> to {true | false} get the lockText of <widget>
counterMaxLengthThe number of characters allowed.set the counterMaxLength of <widget> to pLength get the counterMaxLength of <widget>
variantThe stye of the widget.set the variant of <widget> to variant get the variant of <widget>
focusColorThe color used to remark when widget is focused.set the focusColor of <widget> to <Color> get the focusColor of <widget>
leadingIconShow the leading icon.set the leadingIcon of <widget> to {true | false} get the leadingIcon of <widget>
textThe text contained in the field widget.set the text of <widget> to pText get the text of <widget>
labelThe label of the text fieldset the label of <widget> to pLabel
prefixThe prefix text.set the prefix of <widget> to pText get the prefix of <widget>
floatLabelThe behavior of the label.set the floatLabel of <widget> to floatLabel get the floatLabel of <widget>
counterEnabledThe character counter of the field widgetset the counterEnabled of <widget> to {true | false} get the counterEnabled of <widget>
backgroundColorThe color of the widget's background.set the backgroundColor of <widget> to <Color> get the backgroundColor of <widget>
iconSizeThe size of the arrow icon of the widgetset the iconSize of <widget> to pIconSize get the iconSize of <widget>
placeholderEnabledShow a placeholder.set the placeholderEnabled of <widget> to {true | false} get the placeholderEnabled of <widget>
formattedWidthReports the width needed by the field to display its full contents without scrolling.get the formattedWidth of <widget>
roundedRadiusThe radius of the widget cornersset the roundedRadius of <widget> to pRoundedRadius get the roundedRadius of <widget>
formattedHeightReports the height needed by the field to display its full contents without scrolling.get the formattedHeight of <widget>
helperTextThe text to be shown below the widget.set the helperText of <widget> to pText get the helperText of <widget>
saveContentThis boolean determines content saving behaviour.set the saveContent of <widget> to {true | false} get the saveContent of <widget>
errorEnabledActivates the error states of the widgetset the errorEnabled of <widget> to {true | false} get the errorEnabled of <widget>
textThemeThe text theme mappings of this widgetset the textTheme of <widget> to {<array>} get the textTheme of <widget>
helperTextEnabledshow a assistive text below the widget.set the helperTextEnabled of <widget> to {true | false} get the helperTextEnabled of <widget>
showLabelMake the label visible.set the showLabel of <widget> to {true | false} get the showLabel of <widget>
requiredThe widget content should be filled.set the required of <widget> to {true | false} get the required of <widget>
trailingIconShow the trailing icon.set the trailingIcon of <widget> to {true | false} get the trailingIcon of <widget>
hoverErrorColorThe color of the widget background when the mouse is hovering and the errorEnabled is true.set the hoverErrorColor of <widget> to <Color> get the hoverErrorColor of <widget>
prefixEnabledShow a prefix text in front of content.set the prefixEnabled of <widget> to {true | false} get the prefixEnabled of <widget>
errorColorThe color of the widget text.set the errorColor of <widget> to <Color> get the errorColor of <widget>
themeDataThe theme mappings of this widgetset the themeData of <widget> to {<array>} get the themeData of <widget>
leadingIconNameThe icon name of the leading icon.set the leadingIconName of <widget> to pIcon get the leadingIconName of <widget>
inputTypeThe type of content of the widget.set the inputType of <widget> to inputType get the inputType of <widget>
placeholderTextThe text contained in the placeholder.set the placeholderText of <widget> to pText get the placeholderText of <widget>
visibilityToggleAllows to temporarily unmask the content when inputType is 'password'set the visibilityToggle of <widget> to {true | false} get the visibilityToggle of <widget>
hoverColorThe hover color of the widget's background.set the hoverColor of <widget> to <Color> get the hoverColor of <widget>
suffixThe suffix text.set the suffix of <widget> to pText get the suffix of <widget>
borderColorThe color of the widget's border.set the borderColor of <widget> to <Color> get the borderColor of <widget>
suffixEnabledShow a suffix text after the content.set the suffixEnabled of <widget> to {true | false} get the suffixEnabled of <widget>
borderHoverColorThe color of the widget's border when hovering.set the borderHoverColor of <widget> to <Color> get the borderHoverColor of <widget>
textColorThe color of the widget text.set the textColor of <widget> to <Color> get the textColor of <widget>
trailingIconNameThe icon name of the trailing icon.set the trailingIconName of <widget> to pIcon get the trailingIconName of <widget>
textStyleUse the textStyle property to change the appearance of text.set the textStyle of object to {empty | plain | stylesList}

Message

NameSummarySyntax
stateChangedThis message is sent when the widget 'state' is changed.stateChanged pState
textChangedSent when the content of the widget has changed.textChanged
keyDownSent when the user presses a key.vkeyDown pKeyName
keyUpSent when the user releases a pressed key.keyUp pKeyName
rawKeyDownSent when the user presses any key.rawKeyDown pKeyCode
rawKeyUpSent when the user releases any key that was pressed other than a modifier key.rawKeyUp pKeyCode
rectChangedSent when the widget rect is modified by its content.rectChanged
selectionChangedSent to a field widget when the selection is changed.selectionChanged